<?php
$db = new SimpleXMLElement(file_get_contents("../database.xml"));
foreach($db->pages->page as $page) {
  $page['type'] = "article";
}
// write changes & close up...
$write = fopen("../database.xml","w");
fwrite($write,$db -> asXML());
fclose($write);
?>